//!@author denglibin
//!@date 2025/6/10 9:29
//!@desc

use derive_builder::Builder;
use proc_macro::{table_name, GetFieldNames, HaveFieldType, StructToMap};
use serde::{Deserialize, Serialize};
use sqlx::FromRow;

use my_trait::MustHaveTableName;
use my_trait::MustHaveFieldType;
use my_trait::Struct2Map;

#[derive(Debug, FromRow, Serialize, Deserialize)]
#[derive(Builder, GetFieldNames, StructToMap, HaveFieldType)]
#[table_name("dong_tai")]
pub struct DongTai{
    pub id: i32,
    pub title: String,
    pub author: String,
    pub lei_xing: String,
    pub source_web: String,
    pub pub_time: String,
    pub file_path: String
}

#[derive(Debug, FromRow, Serialize, Deserialize)]
#[derive(Builder, GetFieldNames, StructToMap, HaveFieldType)]
#[table_name("dong_tai2")]
pub struct DongTai2{
    pub id: i32,
    pub title: String,
    pub author: String,
    pub lei_xing: String,
    pub source_web: String,
    pub pub_time: String,
    pub file_path: String
}